package com.mq.publisher.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zx
 * @date 2021/11/2 14:20
 */
@Configuration
public class RabbitConfig {
    @Bean
    Queue objectQueue(){
        return new Queue("object.queue");
    }

    //json序列化
    @Bean
    MessageConverter jsonMessageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}
